package fr.epsi.main;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import com.example.MyLittleHotel.R;
import fr.epsi.activities.absence.AbsenceActivity;
import fr.epsi.activities.alerte.ConsulterAlerteActivity;
import fr.epsi.activities.employe.EmployeActivity;
import fr.epsi.activities.service.ServiceActivity;
import fr.epsi.planning.Planning;

public class MenuActivity extends Activity implements View.OnClickListener{

    ImageButton employes, services, planning, absences, alertes;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        employes = (ImageButton) findViewById(R.id.buttonemployesaccueil);
        services = (ImageButton) findViewById(R.id.buttonservicesaccueil);
        planning = (ImageButton) findViewById(R.id.planning);
        absences = (ImageButton) findViewById(R.id.buttonabsence);
        alertes =  (ImageButton) findViewById(R.id.buttonalertes);

        employes.setOnClickListener(this);
        services.setOnClickListener(this);
        planning.setOnClickListener(this);
        absences.setOnClickListener(this);
        alertes.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {

            ImageButton b = (ImageButton)v;

            if(b==employes){
                Intent e = new Intent(this, EmployeActivity.class);
                startActivity(e);
            }
            if (b == services){
                Intent s = new Intent(this, ServiceActivity.class);
                startActivity(s);
            }
            if(b==planning){
                Intent p = new Intent(this, Planning.class);
                startActivity(p);
            }
            if(b==absences){
                Intent ab = new Intent(this, AbsenceActivity.class);
                startActivity(ab);
            }
            if(b==alertes){
                Intent al = new Intent(this, ConsulterAlerteActivity.class);
                startActivity(al);
            }

        }
    }
